<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.mypic{
				border:20px groove red;
				
			}
		</style>
		<script src="../js/jquery-3.2.1.min.js"></script>
		<script>
			$(function(){
				$("img").toggleClass("mypic");
			});
			//这种事件的方式是不建议的
			//采用绑定机制
			function shiftStyle()
			{
				$("img").toggleClass("mypic");
			}
		</script>
	</head>
	<body>
		<img class="mypic" src="../img/autumn.jpg" />
		<input type="button"  value="切换样式" onclick="shiftStyle()"/>
	</body>
</html>
